package com.xiyue.leaspring.service;

import static org.junit.Assert.assertTrue;

import java.util.List;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.xiyue.leaspring.service.annotation.NewEditCache;
import com.xiyue.leaspring.vo.News;



@CacheConfig(cacheNames = "news")//进行该接口缓存的统一配置
public interface INewsService {

	
	@Cacheable(key="#nid",unless = "#result==null")
	public News get(Long nid);
	
	@NewEditCache
	public News edit(News vo);
	
	@CacheEvict(key="#nid")
	public boolean delete(long nid);
	
	public int save(News vo);
	public void batchSave(List<News> allnews);
	
}
